<?php
use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Banners';
$this->params['breadcrumbs'][] = $this->title;
$this->registerCssFile('/css/banner/app.css');
$this->registerCssFile('/css/banner/fonts.css');
$this->registerCssFile('/css/banner/index.css');

?>
<div class="banner-index">

	<h1><?= Html::encode($this->title) ?></h1>

	<p>
        <?= Html::a('Create Banner', ['create'], ['class' => 'btn btn-success'])?>
    </p>
	<ul class="ul items">
    <?php if(isset($banner[1]) && !empty($banner[1])):?>
    <h2>首页轮播图</h2>
        <?php foreach($banner[1] as $val):?>
            <li>
			<figure class="effect-winston">
				<img id='img1' src="<?=$val['logo']?>">
				<figcaption>
					<h2>
						首页轮播图 <span> 修改与删除 </span>
					</h2>
					<p>
						<a href="/banner/update/<?=$val['id']?>"
							onclick="upBanner(<?=$val['id']?>,this)"> <i class="fa fa-pencil">
						</i>
						</a> <a href="/banner/delete/<?=$val['id']?>" title="删除"
							aria-label="删除" data-confirm="您确定要删除这张图么？" data-method="post"
							data-pjax="0"> <i class="glyphicon glyphicon-remove"> </i>
						</a>
					</p>
				</figcaption>
			</figure>
		</li>
         <?php endforeach;?>
    <?php endif;?>
    </ul>
	<ul class="ul items">
    <?php if(isset($banner[2]) && !empty($banner[2])):?>
    <h2>横幅</h2>
        <?php foreach($banner[2] as $val):?>
            <li>
			<figure class="effect-winston">
				<img id='img1' src="<?=$val['logo']?>">
				<figcaption>
					<h2>
						横幅 <span> 修改与删除 </span>
					</h2>
					<p>
						<a href="/banner/update/<?=$val['id']?>"
							onclick="upBanner(<?=$val['id']?>,this)"> <i class="fa fa-pencil">
						</i>
						</a> <a href="/banner/delete/<?=$val['id']?>" title="删除"
							aria-label="删除" data-confirm="您确定要删除这张图么？" data-method="post"
							data-pjax="0"> <i class="glyphicon glyphicon-remove"> </i>
						</a>
					</p>
				</figcaption>
			</figure>
		</li>
         <?php endforeach;?>
    <?php endif;?>
     </ul>
</div>
